package kr.hkit.androidcomplete02.ch19;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class LongTime extends Activity {
	int mValue;
	TextView tv;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch19_uploadex);
		
		tv = (TextView) findViewById(R.id.ch19_uploadex_tv);
	}
	
	public void mOnClick(View v){
		mValue = 0;
		update();
	}

	private void update() {
		for(int i=0; i<100; i++){
			mValue++;
			tv.setText(Integer.toString(mValue));
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
}
